package br.unirio.parser;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class ParseDisco {
	
	
	public static void main(String[] args) throws Exception {
		
		
		BufferedReader reader = new BufferedReader(new FileReader("src/br/unirio/parser/discos.txt"));
		BufferedWriter writer = new BufferedWriter(new FileWriter("src/br/unirio/parser/script-discos.txt"));
		String linha = reader.readLine();
		String[] parametros = null;
		while(linha != null)
		{
			parametros = linha.split("#");
				writer.append("insert into Album(ID, IDArtista, Nome) values ("+parametros[0]+ ", "+parametros[1]+", \""+parametros[2]+"\" );  \n");
				System.out.println("insert into Album(ID, IDArtista, Nome) values ("+parametros[0]+ ", "+parametros[1]+", \""+parametros[2]+"\" );  \n");
			linha = reader.readLine();
		}
		writer.flush();
}
	}

